package com.sky.mapper;

import com.sky.entity.SetmealDish;
import com.sky.vo.DishItemVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    List<Long> selectSetmealIdByDishId(List<Long> ids);

    void addBatch(List<SetmealDish> setmealDishes);

    @Insert("INSERT INTO setmeal_dish (setmeal_id, dish_id,name,price,copies) VALUES (#{setmealId}, #{dishId}, #{name}, #{price}, #{copies})")
    void addOne(SetmealDish setmealDish);

    @Select("SELECT * FROM setmeal_dish WHERE setmeal_id = #{id}")
    List<SetmealDish> getBySetmealId(Long id);

    void deleteBySetmealIds(List<Long> ids);

    List<DishItemVO> selectDish(Long setmealId);
}
